/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2025-02-09 17:12:06
<<<<<<< HEAD
 * @LastEditTime: 2025-02-26 21:10:51
=======
 * @LastEditTime: 2025-02-26 13:46:00
>>>>>>> 13c5d4bf0f1d02e1b022c211750f7785a8c1596b
 * @FilePath: /monitor_belt/src/api/system/index.ts
 */
import { http } from "@/utils/request";
import { TQuery, TResponse } from "../index.type";
import { data } from "react-router-dom";

// 获取基本信息
export const remoteConfigInfo = () => {
    return http.get<TResponse>(`/web/system/base`);
}

// 修改基本信息
export const updateConfigInfo = (data:TQuery) => {
    return http.post<TResponse>(`/web/system/base`,data);
}

// 获取PLC参数
export const remoteComInfo = () => {
    return http.get<TResponse>(`/web/system/plc`);
}

// 修改PLC参数
export const updateComInfo = (data:TQuery) => {
    return http.post<TResponse>(`/web/system/plc`,data);
}

// 获取设备参数
export const remoteCameraInfo = () => {
    return http.get<TResponse>(`/web/system/dev`);
}

// 修改设备参数
export const updateCameraInfo = (data:TQuery) => {
    return http.post<TResponse>(`/web/system/dev`,data);
}

//删除设备参数
export const deleteCameraInfo = (id:number) => {
    return http.delete<TResponse>(`/web/system/dev/${id}`);
}

// 获取算法参数
export const remoteAiInfo = () => {
    return http.get<TResponse>(`/web/system/ai`);
}

// 修改算法参数
export const updateAiInfo = (data:TQuery) => {
    return http.post<TResponse>(`/web/system/ai`,data);
}

//获取皮带信息
export const remoteConveyors = ()=>{
    return http.get<TResponse>(`/web/system/conveyors`)
}

// 根据id删除皮带信息
export const removeConveyorById = (id:number)=>{
    return http.delete<TResponse>(`/web/system/conveyor/${id}`)
}

// save控制器信息
export const saveControllerInfo =(data:TQuery)=>{
    return http.post<TResponse>(`/web/system/controller`,data)
}

// 查询控制器信息
export const remoteControllerInfo =()=>{
    return http.get<TResponse>(`/web/system/controller`)
}

//删除设备
export const removeDeviceById = (id:number)=>{
    return http.delete<TResponse>(`/web/system/dev/${id}`)
}
